package com.newer.web.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.newer.domain.Inventory;
import com.newer.domain.Supplier;
import com.newer.dto.MaterialSupplierDto;
import com.newer.dto.SupplierDto;
import com.newer.service.InventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liruping
 * @version 1.0
 * Create by 2022/6/23 19:17
 */

@RestController
@RequestMapping("inventory")
public class InventoryController {

    @Autowired
    InventoryService  inventoryService;

    //查询仓库信息
    @RequestMapping("selectInventory")
    public Page<Inventory> selectMaterial(int page,int size,String uname){

        Page page1=new Page();

        page1.setSize(size);
        page1.setCurrent(page);


     Page<Inventory> inventoryPage = this.inventoryService.PageInventorysAll(page1,uname);


        System.out.println("当前页"+inventoryPage.getCurrent());
        System.out.println("每页显示的行数"+inventoryPage.getSize());
        System.out.println("总记录行数"+inventoryPage.getTotal());
        System.out.println("总页数"+inventoryPage.getPages());
        System.out.println("------------------------------");

        return  inventoryPage;

    }






    }
